/**
 * author:Administrator
 * date:2016/1/4
 * desc:TODO
 */

'use strict';

var connedSeq = require('../conn/sequelize.js');
var Sequelize = require('sequelize');
var DataTypes = Sequelize;

var Coupon = connedSeq.define('coupon',
  {
    id: {type: DataTypes.INTEGER(11), allowNull: false, primaryKey: true, autoIncrement: true},
    applyDeadline: {type: DataTypes.INTEGER(11), allowNull: false},
    useDeadline: {type: DataTypes.INTEGER(11), allowNull: false},
    maxCount: {type: DataTypes.INTEGER(11), allowNull: false},
    remain: {type: DataTypes.INTEGER(11), allowNull: false},
    consumeLimit: {type: DataTypes.INTEGER(11), allowNull: false},
    money: {type: DataTypes.INTEGER(11), allowNull: false},
    limitVendorId: {type: DataTypes.INTEGER(11), allowNull: false},
    limitWareId: {type: DataTypes.INTEGER(11), allowNull: false},
    createdAt: {type: DataTypes.INTEGER(11), allowNull: false},
  },

  {
    tableName: 'coupon',
    freezeTableName: true,
    createdAt: false,
    updatedAt: false
  });


module.exports = Coupon;
